package com.example.mybites.test.service;/*
   
/**
* @program: demo
*
* @description: 实现
*
* @author: kk
*
* @create: 2020-02-04 10:36
**/

import com.example.mybites.test.dao.AppleMessageMapper;
import com.example.mybites.test.model.AppleMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class AppleMessageService implements IAppleMessageService {
    @Autowired
   private AppleMessageMapper appleMessageMapper;

    @Override
    public List<AppleMessage> getList() {
        List<AppleMessage> list = new ArrayList<AppleMessage>();
        list.add(appleMessageMapper.selectByPrimaryKey("111"));
        return list;
    }

    @Override
    public AppleMessage getAppleMessage(String id) {

        return appleMessageMapper.selectByPrimaryKey(id);
    }

    @Override
    public int delete(String id) {

        return appleMessageMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int update(AppleMessage appleMessage) {
        return appleMessageMapper.updateByPrimaryKey(appleMessage);
    }

    @Override
    public int  insert(AppleMessage appleMessage) {

        return appleMessageMapper.insert(appleMessage);
    }
}
